#pragma once

#include <iostream>
#include <memory>
#include <stdexcept>
#include <utility>
#include <vector>

#include "SCC/ast/data_types.h"
#include "SCC/ast/stmt_types.h"
#include "SCC/config/scc_config.h"

#include "logger/log.hpp"

namespace scc::ast {

class INode {
public:
  int line = 0;
  const DataType data_type = DataType::kNone;
  StmtType stmt_type = StmtType::kNone;

  std::shared_ptr<INode> parent = {};

  explicit INode(DataType data_type);
  explicit INode(DataType data_type, StmtType stmt_type);
  explicit INode(DataType data_type, StmtType stmt_type, int line);
  virtual ~INode();

  std::shared_ptr<INode> Child(std::size_t node_num);

  std::size_t ChildrenCount() const;
  void AddChild(const std::shared_ptr<INode>& node);

protected:
  std::vector<std::shared_ptr<INode>> children_ = {};
};

} // scc::ast
